package net.xi.dmhome.entity;

import com.baomidou.mybatisplus.annotation.*;


import java.io.Serializable;
import java.util.Date;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;

/**
 * <p>
 * 
 * </p>
 *
 * @author jxhu
 * @since 2021-02-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("dm_user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户名
     */
    @NotEmpty(message="姓名不能为空")
    private String username;

    /**
     * 密码
     */
    @NotEmpty(message = "密码不为空")
    @Length(min = 1,message ="密码不能小于1位")
    private String password;

    /**
     * 用户类型
     */
    private Integer type;

    /**
     * 唯一id
     */
    private String uuid;
    /**
     * 邮箱
     */
    @Email(message = "邮箱格式不对")
    private String email;
    /**
     * 头像
     */
    private String avatar;
    /**
     * 发布帖子数
     */
    private Integer postnumber;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createtime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private Date updatetime;

    /**
     * 是否删除
     */
    @TableLogic
    private Integer isdel;


}
